\(\int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx\) [143]

   Optimal result
   Rubi [A] (verified)
   Mathematica [F]
   Maple [C] (warning: unable to verify)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 19, antiderivative size = 323 \[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{c e}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2} \]

[Out]

I*(a+b*arctan(c*x))^2/c/e+x*(a+b*arctan(c*x))^2/e+d*(a+b*arctan(c*x))^2*ln(2/(1-I*c*x))/e^2+2*b*(a+b*arctan(c*
x))*ln(2/(1+I*c*x))/c/e-d*(a+b*arctan(c*x))^2*ln(2*c*(e*x+d)/(c*d+I*e)/(1-I*c*x))/e^2-I*b*d*(a+b*arctan(c*x))*
polylog(2,1-2/(1-I*c*x))/e^2+I*b^2*polylog(2,1-2/(1+I*c*x))/c/e+I*b*d*(a+b*arctan(c*x))*polylog(2,1-2*c*(e*x+d
)/(c*d+I*e)/(1-I*c*x))/e^2+1/2*b^2*d*polylog(3,1-2/(1-I*c*x))/e^2-1/2*b^2*d*polylog(3,1-2*c*(e*x+d)/(c*d+I*e)/
(1-I*c*x))/e^2

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {4996, 4930, 5040, 4964, 2449, 2352, 4968} \[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=-\frac {i b d \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right ) (a+b \arctan (c x))}{e^2}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {d \log \left (\frac {2}{1-i c x}\right ) (a+b \arctan (c x))^2}{e^2}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(1-i c x) (c d+i e)}\right )}{e^2}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {i (a+b \arctan (c x))^2}{c e}+\frac {2 b \log \left (\frac {2}{1+i c x}\right ) (a+b \arctan (c x))}{c e}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{i c x+1}\right )}{c e} \]

[In]

Int[(x*(a + b*ArcTan[c*x])^2)/(d + e*x),x]

[Out]

(I*(a + b*ArcTan[c*x])^2)/(c*e) + (x*(a + b*ArcTan[c*x])^2)/e + (d*(a + b*ArcTan[c*x])^2*Log[2/(1 - I*c*x)])/e
^2 + (2*b*(a + b*ArcTan[c*x])*Log[2/(1 + I*c*x)])/(c*e) - (d*(a + b*ArcTan[c*x])^2*Log[(2*c*(d + e*x))/((c*d +
 I*e)*(1 - I*c*x))])/e^2 - (I*b*d*(a + b*ArcTan[c*x])*PolyLog[2, 1 - 2/(1 - I*c*x)])/e^2 + (I*b^2*PolyLog[2, 1
 - 2/(1 + I*c*x)])/(c*e) + (I*b*d*(a + b*ArcTan[c*x])*PolyLog[2, 1 - (2*c*(d + e*x))/((c*d + I*e)*(1 - I*c*x))
])/e^2 + (b^2*d*PolyLog[3, 1 - 2/(1 - I*c*x)])/(2*e^2) - (b^2*d*PolyLog[3, 1 - (2*c*(d + e*x))/((c*d + I*e)*(1
 - I*c*x))])/(2*e^2)

Rule 2352

Int[Log[(c_.)*(x_)]/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-e^(-1))*PolyLog[2, 1 - c*x], x] /; FreeQ[{c, d, e
}, x] && EqQ[e + c*d, 0]

Rule 2449

Int[Log[(c_.)/((d_) + (e_.)*(x_))]/((f_) + (g_.)*(x_)^2), x_Symbol] :> Dist[-e/g, Subst[Int[Log[2*d*x]/(1 - 2*
d*x), x], x, 1/(d + e*x)], x] /; FreeQ[{c, d, e, f, g}, x] && EqQ[c, 2*d] && EqQ[e^2*f + d^2*g, 0]

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 4964

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^p)*(
Log[2/(1 + e*(x/d))]/e), x] + Dist[b*c*(p/e), Int[(a + b*ArcTan[c*x])^(p - 1)*(Log[2/(1 + e*(x/d))]/(1 + c^2*x
^2)), x], x] /; FreeQ[{a, b, c, d, e}, x] && IGtQ[p, 0] && EqQ[c^2*d^2 + e^2, 0]

Rule 4968

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^2/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[(-(a + b*ArcTan[c*x])^2)*(Log[
2/(1 - I*c*x)]/e), x] + (Simp[(a + b*ArcTan[c*x])^2*(Log[2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] + S
imp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1 - 2/(1 - I*c*x)]/e), x] - Simp[I*b*(a + b*ArcTan[c*x])*(PolyLog[2, 1
 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/e), x] - Simp[b^2*(PolyLog[3, 1 - 2/(1 - I*c*x)]/(2*e)), x] + Si
mp[b^2*(PolyLog[3, 1 - 2*c*((d + e*x)/((c*d + I*e)*(1 - I*c*x)))]/(2*e)), x]) /; FreeQ[{a, b, c, d, e}, x] &&
NeQ[c^2*d^2 + e^2, 0]

Rule 4996

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Int[Ex
pandIntegrand[(a + b*ArcTan[c*x])^p, (f*x)^m*(d + e*x)^q, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[p,
 0] && IntegerQ[q] && (GtQ[q, 0] || NeQ[a, 0] || IntegerQ[m])

Rule 5040

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*(x_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(-I)*((a + b*ArcT
an[c*x])^(p + 1)/(b*e*(p + 1))), x] - Dist[1/(c*d), Int[(a + b*ArcTan[c*x])^p/(I - c*x), x], x] /; FreeQ[{a, b
, c, d, e}, x] && EqQ[e, c^2*d] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {(a+b \arctan (c x))^2}{e}-\frac {d (a+b \arctan (c x))^2}{e (d+e x)}\right ) \, dx \\ & = \frac {\int (a+b \arctan (c x))^2 \, dx}{e}-\frac {d \int \frac {(a+b \arctan (c x))^2}{d+e x} \, dx}{e} \\ & = \frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2}-\frac {(2 b c) \int \frac {x (a+b \arctan (c x))}{1+c^2 x^2} \, dx}{e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2}+\frac {(2 b) \int \frac {a+b \arctan (c x)}{i-c x} \, dx}{e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2}-\frac {\left (2 b^2\right ) \int \frac {\log \left (\frac {2}{1+i c x}\right )}{1+c^2 x^2} \, dx}{e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2}+\frac {\left (2 i b^2\right ) \text {Subst}\left (\int \frac {\log (2 x)}{1-2 x} \, dx,x,\frac {1}{1+i c x}\right )}{c e} \\ & = \frac {i (a+b \arctan (c x))^2}{c e}+\frac {x (a+b \arctan (c x))^2}{e}+\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2}{1-i c x}\right )}{e^2}+\frac {2 b (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{c e}-\frac {d (a+b \arctan (c x))^2 \log \left (\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}-\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{e^2}+\frac {i b^2 \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{c e}+\frac {i b d (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{e^2}+\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2}{1-i c x}\right )}{2 e^2}-\frac {b^2 d \operatorname {PolyLog}\left (3,1-\frac {2 c (d+e x)}{(c d+i e) (1-i c x)}\right )}{2 e^2} \\ \end{align*}

Mathematica [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx \]

[In]

Integrate[(x*(a + b*ArcTan[c*x])^2)/(d + e*x),x]

[Out]

Integrate[(x*(a + b*ArcTan[c*x])^2)/(d + e*x), x]

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 11.86 (sec) , antiderivative size = 15752, normalized size of antiderivative = 48.77

method result size
derivativedivides \(\text {Expression too large to display}\) \(15752\)
default \(\text {Expression too large to display}\) \(15752\)
parts \(\text {Expression too large to display}\) \(15757\)

[In]

int(x*(a+b*arctan(c*x))^2/(e*x+d),x,method=_RETURNVERBOSE)

[Out]

result too large to display

Fricas [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x}{e x + d} \,d x } \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x+d),x, algorithm="fricas")

[Out]

integral((b^2*x*arctan(c*x)^2 + 2*a*b*x*arctan(c*x) + a^2*x)/(e*x + d), x)

Sympy [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int \frac {x \left (a + b \operatorname {atan}{\left (c x \right )}\right )^{2}}{d + e x}\, dx \]

[In]

integrate(x*(a+b*atan(c*x))**2/(e*x+d),x)

[Out]

Integral(x*(a + b*atan(c*x))**2/(d + e*x), x)

Maxima [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x}{e x + d} \,d x } \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x+d),x, algorithm="maxima")

[Out]

a^2*(x/e - d*log(e*x + d)/e^2) + 1/16*(4*b^2*x*arctan(c*x)^2 - b^2*x*log(c^2*x^2 + 1)^2 + 16*e*integrate(1/16*
(12*(b^2*c^2*e*x^3 + b^2*e*x)*arctan(c*x)^2 + (b^2*c^2*e*x^3 + b^2*e*x)*log(c^2*x^2 + 1)^2 + 8*(4*a*b*c^2*e*x^
3 - b^2*c*e*x^2 - (b^2*c*d - 4*a*b*e)*x)*arctan(c*x) + 4*(b^2*c^2*e*x^3 + b^2*c^2*d*x^2)*log(c^2*x^2 + 1))/(c^
2*e^2*x^3 + c^2*d*e*x^2 + e^2*x + d*e), x))/e

Giac [F]

\[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x}{e x + d} \,d x } \]

[In]

integrate(x*(a+b*arctan(c*x))^2/(e*x+d),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \frac {x (a+b \arctan (c x))^2}{d+e x} \, dx=\int \frac {x\,{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{d+e\,x} \,d x \]

[In]

int((x*(a + b*atan(c*x))^2)/(d + e*x),x)

[Out]

int((x*(a + b*atan(c*x))^2)/(d + e*x), x)